import sys,os

if len(sys.argv)<3:
    print 'Usage: python filterLib.py lib.lst updateScript'
    exit(1)

fiLib=open(sys.argv[1],'r')
fiScr=open(sys.argv[2],'r')
libS=set()
for line in fiLib:
    line=line.strip()
    libS.add(line)
fiLib.close()

for line in fiScr:
    name=line.split('name =\'')[1].split('\';')[0]
    if name in libS:
    	line=line.replace('browser_track','browser_library').strip()
    	print line
fiScr.close()

